package st.business.tepth.business.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangyu
 * @date 2019/2/13
 */
public class ProgramBean implements Parcelable {

    /**
     * operate_user_id : null
     * is_confirmed : 1
     * part : {"material_no":null,"val":2,"unit":null,"repair_plan_id":75,"batch_no":null,"parts_id":35,"id":75,"type":true,"material_name":"刹车滚轮","model_no":null,"head_img_url":null}
     * relation_plan_id : null
     * fault_phenomenon_id : 3
     * material : null
     * action_name : 检修
     * diagnostic_name : 刹车滚轮（坏）
     * fault_diagnostic_id : 75
     * picking_status : -1
     * operate_time : null
     * maintenance_action_id : 11
     */

    private String operate_user_id;
    //0 系统的 1 已经确认的
    private int is_confirmed;
    private PartBean part;
    private String relation_plan_id;
    private int phenomenon_id;
    private PartBean material;
    private String action_name;
    private String diagnostic_name;
    //主作业人
    private PersonBean mainPerson;
    //协作作业人
    private List<PersonBean> personList;
    //系统方案id(记录来源，临时添加的方案为空)
    private int system_repair_plan_id;
    private int fault_diagnostic_id;
    private int picking_status;
    private String operate_time;
    private int maintenance_action_id;
    //0未关联 1关联过来的方案
    private int relation_state;
    private int id;
    private String name;
    private String positionName;
    private String positionCode;

    public String getPositionName() {
        return positionName;
    }

    public void setPositionName(String positionName) {
        this.positionName = positionName;
    }

    public String getPositionCode() {
        return positionCode;
    }

    public void setPositionCode(String positionCode) {
        this.positionCode = positionCode;
    }

    public int getSystem_repair_plan_id() {
        return system_repair_plan_id;
    }

    public void setSystem_repair_plan_id(int system_repair_plan_id) {
        this.system_repair_plan_id = system_repair_plan_id;
    }

    public PersonBean getMainPerson() {
        return mainPerson;
    }

    public void setMainPerson(PersonBean mainPerson) {
        this.mainPerson = mainPerson;
    }

    public List<PersonBean> getPersonList() {
        return personList;
    }

    public void setPersonList(List<PersonBean> personList) {
        this.personList = personList;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getRelation_state() {
        return relation_state;
    }

    public void setRelation_state(int relation_state) {
        this.relation_state = relation_state;
    }

    public String getOperate_user_id() {
        return operate_user_id;
    }

    public void setOperate_user_id(String operate_user_id) {
        this.operate_user_id = operate_user_id;
    }

    public int getIs_confirmed() {
        return is_confirmed;
    }

    public void setIs_confirmed(int is_confirmed) {
        this.is_confirmed = is_confirmed;
    }

    public PartBean getPart() {
        return part;
    }

    public void setPart(PartBean part) {
        this.part = part;
    }

    public String getRelation_plan_id() {
        return relation_plan_id;
    }

    public void setRelation_plan_id(String relation_plan_id) {
        this.relation_plan_id = relation_plan_id;
    }

    public int getPhenomenon_id() {
        return phenomenon_id;
    }

    public void setPhenomenon_id(int phenomenon_id) {
        this.phenomenon_id = phenomenon_id;
    }

    public PartBean getMaterial() {
        return material;
    }

    public void setMaterial(PartBean material) {
        this.material = material;
    }

    public String getAction_name() {
        return action_name;
    }

    public void setAction_name(String action_name) {
        this.action_name = action_name;
    }

    public String getDiagnostic_name() {
        return diagnostic_name;
    }

    public void setDiagnostic_name(String diagnostic_name) {
        this.diagnostic_name = diagnostic_name;
    }

    public int getFault_diagnostic_id() {
        return fault_diagnostic_id;
    }

    public void setFault_diagnostic_id(int fault_diagnostic_id) {
        this.fault_diagnostic_id = fault_diagnostic_id;
    }

    public int getPicking_status() {
        return picking_status;
    }

    public void setPicking_status(int picking_status) {
        this.picking_status = picking_status;
    }

    public String getOperate_time() {
        return operate_time;
    }

    public void setOperate_time(String operate_time) {
        this.operate_time = operate_time;
    }

    public int getMaintenance_action_id() {
        return maintenance_action_id;
    }

    public void setMaintenance_action_id(int maintenance_action_id) {
        this.maintenance_action_id = maintenance_action_id;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.operate_user_id);
        dest.writeInt(this.is_confirmed);
        dest.writeParcelable(this.part, flags);
        dest.writeString(this.relation_plan_id);
        dest.writeInt(this.phenomenon_id);
        dest.writeParcelable(this.material, flags);
        dest.writeString(this.action_name);
        dest.writeString(this.diagnostic_name);
        dest.writeList(this.personList);
        dest.writeInt(this.system_repair_plan_id);
        dest.writeInt(this.fault_diagnostic_id);
        dest.writeInt(this.picking_status);
        dest.writeString(this.operate_time);
        dest.writeInt(this.maintenance_action_id);
        dest.writeInt(this.relation_state);
        dest.writeInt(this.id);
        dest.writeString(this.name);
    }

    public ProgramBean() {
    }

    protected ProgramBean(Parcel in) {
        this.operate_user_id = in.readString();
        this.is_confirmed = in.readInt();
        this.part = in.readParcelable(PartBean.class.getClassLoader());
        this.relation_plan_id = in.readString();
        this.phenomenon_id = in.readInt();
        this.material = in.readParcelable(PartBean.class.getClassLoader());
        this.action_name = in.readString();
        this.diagnostic_name = in.readString();
        this.personList = new ArrayList<PersonBean>();
        in.readList(this.personList, PersonBean.class.getClassLoader());
        this.system_repair_plan_id = in.readInt();
        this.fault_diagnostic_id = in.readInt();
        this.picking_status = in.readInt();
        this.operate_time = in.readString();
        this.maintenance_action_id = in.readInt();
        this.relation_state = in.readInt();
        this.id = in.readInt();
        this.name = in.readString();
    }

    public static final Parcelable.Creator<ProgramBean> CREATOR = new Parcelable.Creator<ProgramBean>() {
        @Override
        public ProgramBean createFromParcel(Parcel source) {
            return new ProgramBean(source);
        }

        @Override
        public ProgramBean[] newArray(int size) {
            return new ProgramBean[size];
        }
    };
}
